//
// Created by lingzhitech on 25-9-24.
//

#ifndef UTILS_HPP
#define UTILS_HPP
#include <iostream>
#include <string>
#include <vector>

#include "Sales_data.h"

template <typename Container>
void print_container(const Container& c, const std::string& sep = " ") {
    for (auto it = c.begin(); it != c.end(); ++it) {
        std::cout << *it;
        if (std::next(it) != c.end())    {
            std::cout << sep; // 分隔符
        }
    }
    std::cout << "\n";
}

template <typename Container, typename Iter>
void print_container(const Container& c, const Iter end, const std::string& sep = " ") {
    for (auto it = c.begin(); it != end; ++it) {
        std::cout << *it;
        if (std::next(it) != c.end())    {
            std::cout << sep; // 分隔符
        }
    }
    std::cout << "\n";
}

std::string make_plural(size_t ctr, const std::string &word,
                        const std::string &ending);

void elimDups(std::vector<std::string>& words);

bool isShorter(const std::string &s1, const std::string &s2);




bool compareIsbn(const Sales_data &s1, const Sales_data &s2);

bool isOver5Charaters(std::string &s);

bool isOverSize(const std::string &word, std::size_t sz);

bool check_size(const std::string &s, std::string::size_type sz);










#endif //UTILS_HPP
